# -*- coding: utf-8 -*-


from PyQt5.QtWidgets import QWidget, QLineEdit, QFormLayout, QApplication
import sys


class LinE(QWidget):
    def __init__(self):
        super(LinE, self).__init__()
        flo = QFormLayout()
        lin = QLineEdit()
        # 隐藏密码
        lin.setEchoMode(QLineEdit.Password)
        flo.addRow(lin)
        lin.editingFinished.connect(self.text)  # 无法自动完成传参，无法获取到文本
        lin.setPlaceholderText("请输入密码")

        self.setLayout(flo)

    # def text(self,text):
    #     print("已经完成输入",text)

    def text(self):
        print("已经完成输入")


if __name__ == '__main__':
    app = QApplication(sys.argv)
    line = LinE()
    line.show()
    sys.exit(app.exec_())
